<ui:composition template="/admin/templates/ui.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:archer="http://java.sun.com/jsf/archer"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<f:metadata>
		<f:viewParam name="supId" value="#{weMenuHome.supId}"></f:viewParam>
	</f:metadata>

	<ui:define name="content">
		<div class="entry">
			<p:toolbar>
				<p:toolbarGroup>
					<h:outputLabel style="padding-left: 15px;"
						value="#{commonMsg.currentPositionLabel} 产品费率参数配置"></h:outputLabel>
				</p:toolbarGroup>
				<p:toolbarGroup align="right">
					<p:separator />
					<p:button value="新增费率参数" outcome="/admin/test/LoanFeeAdd"></p:button>
				</p:toolbarGroup>
			</p:toolbar>
			<p:spacer></p:spacer>
			<h:form id="form">
				<p:spacer></p:spacer>
				<p:panel id="filters">
					<h:panelGrid columns="8" styleClass="filter-grid"
						rowClasses="filter-row"
						columnClasses="filter-col1,filter-col2,filter-col3">
						
						
						
						<h:outputLabel value="产品名称："></h:outputLabel>
						<h:inputText id="loanType"
							value="#{loanFeeList.example.loanType.name}"></h:inputText>
							
							<h:outputLabel value="费用名称："></h:outputLabel>
						<h:inputText id="feeName"
							value="#{loanFeeList.example.systemFee.name}"></h:inputText>

						<h:outputLabel value="费用状态："></h:outputLabel>
						<h:selectOneMenu value="#{loanFeeList.example.status}">
							<f:selectItem itemLabel="--费用状态--" noSelectionOption="true" />
							<f:selectItem itemLabel="使用中" itemValue="1" />
							<f:selectItem itemLabel="停用" itemValue="2" />
						</h:selectOneMenu>
						
						<h:outputLabel value="费用类型："></h:outputLabel>
						<h:selectOneMenu value="#{loanFeeList.example.feeType}">
							<f:selectItem itemLabel="--费用类型--" noSelectionOption="true" />
							<f:selectItem itemLabel="比例" itemValue="1" />
							<f:selectItem itemLabel="固定" itemValue="2" />
						</h:selectOneMenu>
						
						<p:spacer></p:spacer>
						<p:spacer></p:spacer>
						
						
						


						<h:outputText value="操作："></h:outputText>
						<ui:fragment>
							<p:commandButton update="dataTable" process="filters"
								value="#{commonMsg.searchLabel}"></p:commandButton>
							<p:button value="#{commonMsg.resetLabel}"
								onclick="location.reload();return;"></p:button>
						</ui:fragment>
						<p:watermark for="loanType" value="产品名称"></p:watermark>
                		<p:watermark for="feeName" value="费用名称"></p:watermark> 
 						<p:spacer></p:spacer><p:spacer></p:spacer>
					</h:panelGrid>
				</p:panel>
				<!-- 数据列表 -->
				<p:dataTable id="dataTable" value="#{loanFeeList.lazyModel}"
					var="loanFee" paginator="true" paginatorPosition="bottom"
					rowsPerPageTemplate="15,50,100"
					rows="15" lazy="true" emptyMessage="#{commonMsg.noResultMsg}" 
					currentPageReportTemplate="#{commonMsg.pageReportTemplate}"
					paginatorTemplate="#{commonMsg.paginatorTemplate}">
					
					<p:column>
						<f:facet name="header">
							<h:outputText value="产品名称"></h:outputText>
						</f:facet>
						<h:outputText value="#{loanFee.loanType.name}"></h:outputText>
					</p:column>
					<p:column >
						<f:facet name="header">
							<h:outputText value="费用名称"></h:outputText>
						</f:facet>
						<h:outputText value="#{loanFee.systemFee.name}"></h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="费用类型"></h:outputText>
						</f:facet>
						<h:outputText value="比例" 
							rendered="#{loanFee.feeType == '1'}"></h:outputText>	
						<h:outputText value="固定" 
							
							rendered="#{loanFee.feeType == '2'}"></h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="费用"></h:outputText>
						</f:facet>
						<h:outputText value="#{loanFee.feeMoney}%" 
							rendered="#{loanFee.feeType == '1'}"></h:outputText>	
						<h:outputText value="#{loanFee.feeMoney}" 
							
							rendered="#{loanFee.feeType == '2'}"></h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="状态"></h:outputText>
						</f:facet>
						<h:outputText value="使用中" 
							rendered="#{loanFee.status == '1'}"></h:outputText>	
						<h:outputText value="停用" 
							style="color:red;"
							rendered="#{loanFee.status == '2'}"></h:outputText>
					</p:column>
					<p:column headerText="#{commonMsg.actionLabel}" exportable="false">
					<h:link value="编辑" outcome="/admin/system/LoanFeeAdd?id=#{loanFee.id}"></h:link>
					<p:spacer></p:spacer>
					&#160;&#160;
					<p:spacer></p:spacer>
					<p:commandLink value="删除" update="@form" onstart="return confirm('您确定要删除？')" 
						action="#{loanFeeHome.delete(loanFee.id)}"></p:commandLink>
				</p:column>
				<f:facet name="footer"> 
						<p:commandButton value="导出Excel" ajax="false">
							<p:dataExporter target="dataTable" type="xls" 
								fileName="systemLoanFee" pageOnly="false"></p:dataExporter>
						</p:commandButton>
	 		        </f:facet>
				</p:dataTable>
			</h:form>
		</div>
	</ui:define>
</ui:composition>

